#ifndef INCLUDED_SESSIONSDEF_H
#define INCLUDED_SESSIONSDEF_H

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif

#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <stdarg.h>

inline std::string _isspace(const std::string& src)
{
    std::vector<std::string> res;
    std::string srcst(src);
    srcst.erase(std::remove_if(srcst.begin(), srcst.end(), ::isspace), srcst.end());
    return srcst;
}

#define FSEP ","
//=======================================================================================
// 1M
#define F_1M_21012300 "2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2139,2140,2141,2142,2143,2144,2145,2146,2147,2148,2149, \
                    2150,2151,2152,2153,2154,2155,2156,2157,2158,2159,2200,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239, \
                    2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2300"
#define F_1M_23010100 "2301,2302,2303,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339, \
                    2340,2341,2342,2343,2344,2345,2346,2347,2348,2349,2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,0000,0001,0002,0003,0004,0005,0006,0007,0008,0009,0010,0011,0012,0013,0014,0015,0016,0017,008,0019, \
                    0020,0021,0022,0023,0024,0025,0026,0027,0028,0029,0030,0031,0032,0033,0034,0035,0036,0037,0038,0039,0040,0041,0042,0043,0044,0045,0046,0047,0048,0049,0050,0051,002,0053,0054,0055,0056,0057,0058,0059,0100"
#define F_1M_01010230 "0101,0102,0103,0104,0105,0106,0107,0108,0109,0110,0111,0112,0113,0114,0115,0116,0117,0118,0119,0120,0121,0122,0123,0124,0125,0126,0127,0128,0129,0130,0131,0132,0133,0134,0135,0136,0137,0138,0139,0140,0141,0142,0143,0144,0145,0146,0147,0148,0149,0150,0151,0152,0153,0154,0155,0156,0157,0158,0159,0200,0201,0202,0203,0204,0205,0206,0207,0208,0209,0210,0211,0212,0213,0214,0215,0216,0217,0218,0219,0220,0221,0222,0223,0224,0225,0226,0227,0228,0229,0230"
#define F_1M_09010930 "0901,0902,0903,0904,0905,0906,0907,0908,0909,0910,0911,0912,0913,0914,0915,0916,0917,0918,0919,0920,0921,0922,0923,0924,0925,0926,0927,0928,0929,0930"
#define F_1M_09311015 "0931,0932,0933,0934,0935,0936,0937,0938,0939,0940,0941,0942,0943,0944,0945,0946,0947,0948,0949,0950,0951,0952,0953,0954,0955,0956,0957,0958,0959,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015"
#define F_1M_10161030 "1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030"
#define F_1M_10311130 "1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130"
#define F_1M_13011330 "1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325,1326,1327,1328,1329,1330"
#define F_1M_13311500 "1331,1332,1333,1334,1335,1336,1337,1338,1339,1340,1341,1342,1343,1344,1345,1346,1347,1348,1349,1350,1351,1352,1353,1354,1355,1356,1357,1358,1359, \
                    1400,1401,1402,1403,1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,1414,1415,1416,1417,1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1428,1429, \
                    1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1500"
#define F_1M_15011515 "1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,15"                
#define F_1M_09011500 F_1M_09010930 FSEP F_1M_09311015 FSEP F_1M_10311130 FSEP F_1M_13311500
#define FN2300_M1  _isspace(F_1M_21012300 FSEP F_1M_09011500)
#define FN0100_M1  _isspace(F_1M_21012300 FSEP F_1M_23010100 FSEP F_1M_09011500)
#define FN0230_M1  _isspace(F_1M_21012300 FSEP F_1M_23010100 FSEP F_1M_01010230 FSEP F_1M_09011500)
#define FD0900_M1  _isspace(F_1M_09011500)
#define FD1515_M1  _isspace(F_1M_09311015 FSEP F_1M_10161030 FSEP F_1M_10311130 FSEP F_1M_13011330 FSEP F_1M_13311500 FSEP F_1M_15011515)
#define SD0930_M1  _isspace(F_1M_09311015 FSEP F_1M_10161030 FSEP F_1M_10311130 FSEP F_1M_13011330 FSEP F_1M_13311500)
//=======================================================================================
// 3M
#define F_3M_21032300 "2103,2106,2109,2112,2115,2118,2121,2124,2127,2130,2133,2236,2239,2242,2245,2248,2251,2254,2257,2300"
#define F_3M_23030100 "2303,2306,2309,2312,2315,2318,2321,2324,2327,2330,2333,2336,2339,2342,2345,2348,2351,2354,2357,0000,0003,0006,0009,0012,0015,0018,0021,0024,0027,0030,0033,0036,0039,0042,0045,0048,0051,0054,0057,0100"
#define F_3M_01030230 "0103,0116,0109,0112,0115,0118,0121,0124,0127,0130,0133,0136,0139,0142,0145,0148,0151,0154,0157,0200,0203,0206,0209,0212,0215,0218,0221,0224,0227,0230"
#define F_3M_09031130 "0903,0906,0909,0912,0915,0918,0921,0924,0927,0930,0933,0936,0939,0942,0945,0948,0951,0954,0957,1000,1003,1006,1009,1012,1015,1033,1036,1039,1042,1045,1048,1051,1054,1057,1100,1103,1106,1109,1112,1115,1118,1121,1124,1127,1130"
#define F_3M_09331130 "0933,0936,0939,0942,0945,0948,0951,0954,0957,1000,1003,1006,1009,1012,1015,1033,1036,1039,1042,1045,1048,1051,1054,1057,1100,1103,1106,1109,1112,1115,1118,1121,1124,1127,1130"
#define S_3M_09331130 "0933,0936,0939,0942,0945,0948,0951,0954,0957,1000,1003,1006,1009,1012,1015,1018,1021,1024,1027,1030,1033,1036,1039,1042,1045,1048,1051,1054,1057,1100,1103,1106,1109,1112,1115,1118,1121,1124,1127,1130"
#define F_3M_13331500 "1333,1336,1339,1342,1345,1348,1351,1354,1357,1400,1403,1406,1409,1412,1415,1418,1421,1424,1427,1430,1433,1436,1439,1442,1445,1448,1451,1454,1457,1500"
#define F_3M_13031500 "1303,1306,1309,1312,1315,1318,1321,1324,1327,1330,1333,1336,1339,1342,1345,1348,1351,1354,1357,1400,1403,1406,1409,1412,1415,1418,1421,1424,1427,1430,1433,1436,1439,1442,1445,1448,1451,1454,1457,1500"
#define F_3M_15031515 "1503,1506,1509,1512,1515"
#define FN2300_M3  _isspace(F_3M_21032300 FSEP F_3M_09031130 FSEP F_3M_13331500)
#define FN0100_M3  _isspace(F_3M_21032300 FSEP F_3M_23030100 FSEP F_3M_09031130 FSEP F_3M_13331500)
#define FN0230_M3  _isspace(F_3M_21032300 FSEP F_3M_23030100 FSEP F_3M_01030230 FSEP F_3M_09031130 FSEP F_3M_13331500)
#define FD0900_M3  _isspace(F_3M_09031130 FSEP F_3M_13331500)
#define FD1515_M3  _isspace(S_3M_09331130 FSEP F_3M_13031500 FSEP F_3M_15031515)
#define SD0930_M3  _isspace(S_3M_09331130 FSEP F_3M_13031500)
//=======================================================================================
// 5M
#define F_5M_21052300 "2105,2110,2115,2120,2125,2130,2135,2140,2145,2150,2155,2200,2205,2210,2215,2220,2225,2230,2235,2240,2245,2250,2255,2300"
#define F_5M_23050100 "2305,2310,2315,2320,2325,2330,2335,2340,2345,2350,2355,0000,0005,0010,0015,0020,0025,0030,0035,0040,0045,0050,0055,0100"
#define F_5M_01050230 "0105,0110,0115,0120,0125,0130,0135,0140,0145,0150,0155,0200,0205,0210,0215,0220,0225,0230"
#define F_5M_09051500 "0905,0910,0915,0920,0925,0930,0935,0940,0945,0950,0955,1000,1005,1010,1015,1035,1040,1045,1050,1055,1100,1105,1110,1115,1120,1125,1330,1335,1340,1345,1350,1355,1400,1405,1410,1415,1420,1425,1430,1435,1440,1445,1450,1455,1500"
#define S_5M_09351500 "0935,0940,0945,0950,0955,1000,1005,1010,1015,1020,1025,1030,1035,1040,1045,1050,1055,1100,1105,1110,1115,1120,1125,1300,1305,1310,1315,1320,1325,1330,1335,1340,1345,1350,1355,1400,1405,1410,1415,1420,1425,1430,1435,1440,1445,1450,1455,1500"
#define F_5M_15051515 "1505,1510,1515"
#define FN2300_M5  _isspace(F_5M_21052300 FSEP F_5M_09051500)
#define FN0100_M5  _isspace(F_5M_21052300 FSEP F_5M_23050100 FSEP F_5M_09051500)
#define FN0230_M5  _isspace(F_5M_21052300 FSEP F_5M_23050100 FSEP F_5M_01050230 FSEP F_5M_09051500)
#define FD0900_M5  _isspace(F_5M_09051500)
#define FD1515_M5  _isspace(S_5M_09351500 FSEP F_5M_15051515)
#define SD0930_M5  _isspace(S_5M_09351500)
//=======================================================================================
// 10M
#define FN2300_M10  "2110,2120,2130,2140,2150,2200,2210,2220,2230,2240,2250,0900,0910,0920,0930,0940,0950,1000,1010,1035,1045,1055,1105,1115,1125,1335,1345,1355,1405,1415,1425,1435,1445,1455,1500"
#define FN0100_M10  "2110,2120,2130,2140,2150,2200,2210,2220,2230,2240,2250,2300,2310,2320,2330,2340,2350,0000,0010,0020,0030,0040,0050,0900,0910,0920,0930,0940,0950,1000,1010,1035,1045,1055,1105,1115,1125,1335,1345,1355,1405,1415,1425,1435,1445,1455,1500"
#define FN0230_M10  "2110,2120,2130,2140,2150,2200,2210,2220,2230,2240,2250,2300,2310,2320,2330,2340,2350,0000,0010,0020,0030,0040,0050,0100,0110,0120,0130,0140,0150,0200,0210,0220,0900,0910,0920,0930,0940,0950,1000,1010,1035,1045,1055,1105,1115,1125,1335,1345,1355,1405,1415,1425,1435,1445,1455,1500"
#define FD0900_M10  "0910,0920,0930,0940,0950,1000,1010,1035,1045,1055,1105,1115,1125,1335,1345,1355,1405,1415,1425,1435,1445,1455,1500"
#define FD1515_M10  "0940,0950,1000,1010,1020,1030,1040,1050,1100,1110,1120,1300,1310,1320,1330,1340,1350,1400,1410,1420,1430,1440,1450,1500,1510,1515"
#define SD0930_M10  "0940,0950,1000,1010,1020,1030,1040,1050,1100,1110,1120,1300,1310,1320,1330,1340,1350,1400,1410,1420,1430,1440,1450,1500"
//=======================================================================================
// 15M
#define FN2300_M15  "2115,2130,2145,2200,2215,2230,2245,0900,0915,0930,0945,1000,1030,1045,1100,1115,1330,1345,1400,1415,1430,1445,1500"
#define FN0100_M15  "2115,2130,2145,2200,2215,2230,2245,2300,2315,2330,2345,0000,0015,0030,0045,0900,0915,0930,0945,1000,1030,1045,1100,1115,1330,1345,1400,1415,1430,1445,1500"
#define FN0230_M15  "2115,2130,2145,2200,2215,2230,2245,2300,2315,2330,2345,0000,0015,0030,0045,0100,0115,0130,0145,0200,0215,0900,0915,0930,0945,1000,1030,1045,1100,1115,1330,1345,1400,1415,1430,1445,1500"
#define FD0900_M15  "0915,0930,0945,1000,1030,1045,1100,1115,1330,1345,1400,1415,1430,1445,1500"
#define FD1515_M15  "0945,1000,1015,1030,1045,1100,1115,1300,1315,1330,1345,1400,1415,1430,1445,1500,1515"
#define SD0930_M15  "0945,1000,1015,1030,1045,1100,1115,1300,1315,1330,1345,1400,1415,1430,1445,1500"
//=======================================================================================
// 30M
#define FN2300_M30  "2100,2130,2200,2230,0900,0930,1000,1045,1115,1345,1415,1445,1500"
#define FN0100_M30  "2100,2130,2200,2230,2300,2330,0000,0030,0900,0930,1000,1045,1115,1345,1415,1445,1500"
#define FN0230_M30  "2100,2130,2200,2230,2300,2330,0000,0030,0100,0130,0200,0900,0930,1000,1045,1115,1345,1415,1445,1500"
#define FD0900_M30  "0900,0930,1000,1045,1115,1345,1415,1445,1500"
#define FD1515_M30  "0930,1000,1030,1100,1300,1330,1400,1430,1500,1515"
#define SD0930_M30  "0930,1000,1030,1100,1300,1330,1400,1430,1500"
//=======================================================================================
// 1H
#define FN2300_H1  "2100,2200,0900,1000,1115,1415,1500"
#define FN0100_H1  "2100,2200,2300,0000,0900,1000,1115,1415,1500"
#define FN0230_H1  "2100,2200,2300,0000,0100,0200,0930,1045,1345,1445,1500"
#define FD0900_H1  "0900,1000,1115,1415,1500"
#define FD1515_H1  "0930,1030,1330,1430,1515"
#define SD0930_H1  "0930,1030,1300,1400,1500"
//=======================================================================================
// 2H
#define FN2300_H2  "2100,0900,1115,1500"
#define FN0100_H2  "2100,2300,0900,1115,1500"
#define FN0230_H2  "2100,2300,0100,0900,1115,1500"
#define FD0900_H2  "0900,1115,1500"
#define FD1515_H2  "0930,1300,1500,1515"
#define SD0930_H2  "0930,1300,1500"

//=================================================

static std::map<std::string, std::string>  g_static_session_mapping = {
    {"FN2300_M1", std::string(FN2300_M1)},
    {"FN0100_M1", std::string(FN0100_M1)},
    {"FN0230_M1", std::string(FN0230_M1)},
    {"FD0900_M1", std::string(FD0900_M1)},
    {"FD1515_M1", std::string(FD1515_M1)},
    {"SD0930_M1", std::string(SD0930_M1)},
    //-------------------------
    {"FN2300_M3", std::string(FN2300_M3)},
    {"FN0100_M3", std::string(FN0100_M3)},
    {"FN0230_M3", std::string(FN0230_M3)},
    {"FD0900_M3", std::string(FD0900_M3)},
    {"FD1515_M3", std::string(FD1515_M3)},
    {"SD0930_M3", std::string(SD0930_M3)},
    //-------------------------
    {"FN2300_M5", std::string(FN2300_M5)},
    {"FN0100_M5", std::string(FN0100_M5)},
    {"FN0230_M5", std::string(FN0230_M5)},
    {"FD0900_M5", std::string(FD0900_M5)},
    {"FD1515_M5", std::string(FD1515_M5)},
    {"SD0930_M5", std::string(SD0930_M5)},
    //-------------------------
    {"FN2300_M10", std::string(FN2300_M10)},
    {"FN0100_M10", std::string(FN0100_M10)},
    {"FN0230_M10", std::string(FN0230_M10)},
    {"FD0900_M10", std::string(FD0900_M10)},
    {"FD1515_M10", std::string(FD1515_M10)},
    {"SD0930_M10", std::string(SD0930_M10)},
    //-------------------------
    {"FN2300_M15", std::string(FN2300_M15)},
    {"FN0100_M15", std::string(FN0100_M15)},
    {"FN0230_M15", std::string(FN0230_M15)},
    {"FD0900_M15", std::string(FD0900_M15)},
    {"FD1515_M15", std::string(FD1515_M15)},
    {"SD0930_M15", std::string(SD0930_M15)},
    //-------------------------
    {"FN2300_M30", std::string(FN2300_M30)},
    {"FN0100_M30", std::string(FN0100_M30)},
    {"FN0230_M30", std::string(FN0230_M30)},
    {"FD0900_M30", std::string(FD0900_M30)},
    {"FD1515_M30", std::string(FD1515_M30)},
    {"SD0930_M30", std::string(SD0930_M30)},
    //-------------------------
    {"FN2300_H1", std::string(FN2300_H1)},
    {"FN0100_H1", std::string(FN0100_H1)},
    {"FN0230_H1", std::string(FN0230_H1)},
    {"FD0900_H1", std::string(FD0900_H1)},
    {"FD1515_H1", std::string(FD1515_H1)},
    {"SD0930_H1", std::string(SD0930_H1)},
    //-------------------------
    {"FN2300_H2", std::string(FN2300_H2)},
    {"FN0100_H2", std::string(FN0100_H2)},
    {"FN0230_H2", std::string(FN0230_H2)},
    {"FD0900_H2", std::string(FD0900_H2)},
    {"FD1515_H2", std::string(FD1515_H2)},
    {"SD0930_H2", std::string(SD0930_H2)}
};
//=================================================
//=================================================

#endif